<template>
  <div class="category">
    <div class="category_item category_item_1">
      <div class="sub_item" v-for="item in categories1" :key="item.id">
        <div>{{item.name}}</div>
      </div>
    </div>
    <div class="category_item category_item_2"></div>
    <div class="category_item category_item_3"></div>
    <Button type="primary">补充商品信息</Button>
  </div>
</template>

<script>
import { getCategoriesByParent } from '../../../api/CategoryApi'

export default {
  data () {
    return {
      categories1: '',
      categories2: '',
      categories3: '',
      currentSelect: 1,
      currentParent: null,
    }
  },
  methods: {
    async getCategoriesByParent () {
      this[`categories${this.currentSelect}`] = await getCategoriesByParent(this.currentParent)
    },
  },
  created () {
    this.getCategoriesByParent()
  },
}
</script>

<style>

</style>